package com.slipper.system.dictionary.controller;

import com.slipper.system.dictionary.bo.DictionaryDataBO;
import com.slipper.system.dictionary.bo.DictionaryDataBOs;
import com.slipper.system.dictionary.service.DictionaryDataService;
import com.slipper.util.ResultUtil;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/system/dictionaryData")
public class DictionaryDataController {
    @Resource
    private DictionaryDataService dictionaryDataService;

    @PostMapping("/queryPage")
    public String queryPage(@RequestBody DictionaryDataBO bo) {
        return ResultUtil.successResult(dictionaryDataService.queryPage(bo));
    }

    @PostMapping("/save")
    public String save(@RequestBody DictionaryDataBO bo) {
        return ResultUtil.saveResult(dictionaryDataService.save(bo));
    }
    
    @PostMapping("/saves")
    public String saves(@RequestBody DictionaryDataBOs bos) {
        return ResultUtil.saveResult(dictionaryDataService.saves(bos));
    }

    @PostMapping("/queryBy")
    public String queryBy(@RequestBody DictionaryDataBO bo) {
        return ResultUtil.successResult(dictionaryDataService.queryBy(bo.getId()));
    }

    @PostMapping("/delete")
    public String delete(@RequestBody DictionaryDataBO bo) {
        return ResultUtil.deleteResult(dictionaryDataService.delete(bo));
    }
    
    @PostMapping("/saveByCode")
    public String saveByCode(@RequestBody DictionaryDataBOs bos) {
        return ResultUtil.saveResult(dictionaryDataService.saveByCode(bos));
    }
}
